#include <bits/stdc++.h>
using namespace std;
int cnt[110];
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    memset(cnt, 0, sizeof(cnt));
    int n;
    bool two_same = false, has_zero = false;
    int non_zero = 0;
    cin >> n;
    while (n--) {
      int x;
      cin >> x;
      if (x == 0)
        has_zero = true;
      else
        non_zero++;
      if (cnt[x]) two_same = true;
      cnt[x]++;
    }
    if (has_zero) {
      cout << non_zero << endl;
    } else if (two_same) {
      cout << non_zero << endl;
    } else {
      cout << non_zero + 1 << endl;
    }
  }
}
